package com.krain.ddbb.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * 用户实体类
 * Created by ex-kuangxiaomin101 on 2015-12-14.
 */
public class UserInfoBean implements Parcelable {

    private String access_token;
    private PersonDetailBean detail;
    private UserCardBean userCard;
    private int uid;
    private ArrayList<WorkNameBean> work;
    private PersonArdessBean address;

    public String getAccess_token() {
        return access_token;
    }

    public void setAccess_token(String access_token) {
        this.access_token = access_token;
    }

    public PersonDetailBean getDetail() {
        return detail;
    }

    public void setDetail(PersonDetailBean detail) {
        this.detail = detail;
    }

    public UserCardBean getUserCard() {
        return userCard;
    }

    public void setUserCard(UserCardBean userCard) {
        this.userCard = userCard;
    }

    public ArrayList<WorkNameBean> getWork() {
        return work;
    }

    public void setWork(ArrayList<WorkNameBean> work) {
        this.work = work;
    }

    public PersonArdessBean getAddress() {
        return address;
    }

    public void setAddress(PersonArdessBean address) {
        this.address = address;
    }

    public int getUid() {
        return uid;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }

    public UserInfoBean() {
    }

    @Override
    public String toString() {
        return "UserInfoBean{" +
                "access_token='" + access_token + '\'' +
                ", detail=" + detail +
                ", userCard=" + userCard +
                ", work=" + work +
                ", address=" + address +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.access_token);
        dest.writeParcelable(this.detail, 0);
        dest.writeParcelable(this.userCard, 0);
        dest.writeInt(this.uid);
        dest.writeTypedList(work);
        dest.writeParcelable(this.address, 0);
    }

    protected UserInfoBean(Parcel in) {
        this.access_token = in.readString();
        this.detail = in.readParcelable(PersonDetailBean.class.getClassLoader());
        this.userCard = in.readParcelable(UserCardBean.class.getClassLoader());
        this.uid = in.readInt();
        this.work = in.createTypedArrayList(WorkNameBean.CREATOR);
        this.address = in.readParcelable(PersonArdessBean.class.getClassLoader());
    }

    public static final Creator<UserInfoBean> CREATOR = new Creator<UserInfoBean>() {
        public UserInfoBean createFromParcel(Parcel source) {
            return new UserInfoBean(source);
        }

        public UserInfoBean[] newArray(int size) {
            return new UserInfoBean[size];
        }
    };
}
